package NenuTest.Pages;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

import java.util.concurrent.TimeUnit;

/**
 * Created with IntelliJ IDEA.
 * User: stem
 * Date: 24.11.13
 * Time: 15:03
 * To change this template use File | Settings | File Templates.
 */
public class menuPage {
    private WebDriver driver;
    public By email = By.xpath("//div[@id='__pageBody']//div[@class='ttMargin']//div[contains(text(),'@')]");
    private By upgr= By.xpath("(//div[@id='__pageBody']//div[@class='ttMargin'])[1]//a[contains(text(),'Upgrade')]");
    private By inv= By.xpath("(//div[@id='__pageBody']//div[@class='ttMargin'])[1]//a[contains(text(),'Invite Friends')]");
    private By help= By.xpath("(//div[@id='__pageBody']//div[@class='ttMargin'])[1]//div[contains(text(),'Help')][@class='drpdwnHandler']");
    private By acnt= By.xpath("(//div[@id='__pageBody']//div[@class='ttMargin'])[1]//div[contains(text(),'Account')][@class='drpdwnHandler']");
    public menuPage(WebDriver driver) {
        this.driver=driver;
        driver.get("https://www.buxfer.com");
    }

    public summaryPage smr(){
        By value= new By.ById("tab-home");
        driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
        driver.findElement(value).click();
        return new summaryPage(driver);
    }
    public addTransactionPage addTrans(){
        By value= new By.ById("tab-add_transaction");
        driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
        driver.findElement(value).click();
        return new addTransactionPage(driver);
    }
    public reportsPage report(){
        By value= new By.ById("tab-reports");
        driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
        driver.findElement(value).click();
        return new reportsPage(driver);
    }
    public budgetsPage budgets(){
        By value= new By.ById("tab-budgets");
        driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
        driver.findElement(value).click();
        return new budgetsPage(driver);
    }
    public remindersPage reminders(){
        By value= new By.ById("tab-reminders");
        driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
        driver.findElement(value).click();
        return new remindersPage(driver);
    }
    public forecastPage forecast(){
        By value= new By.ById("tab-forecast");
        driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
        driver.findElement(value).click();
        return new forecastPage(driver);
    }
    public paymentsPage pay(){
        By value= new By.ById("tab-payments");
        driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
        driver.findElement(value).click();
        return new paymentsPage(driver);
    }

}
